<template>
  <el-dialog :visible.sync="pop_select" title="文字结果录入" :close-on-click-modal="false" :center="true" v-el-drag-dialog width="830px" append-to-body>
      <div style="height: 480px; border: 0px solid #eee;width:100%">
          <div class="reportoper">
              <table style="padding-top:0px;border-spacing:0px">
                  <tr>
                      <!--el-tag>说明:仅可修改数量, 数量修改为 0 的则无需计价!</el-tag-->
                      <td style="width:640px">
                          <span style="margin-right:5px;font-size:18px;font-weight:bold;color:blue">{{poptitle}}</span>
                      </td>
                      <td style="width:70px">
                          <el-button @click="Select_ok">确认</el-button>
                      </td>
                      <td style="width:70px">
                          <el-button @click="Select_cancle">取消</el-button>
                      </td>
                  </tr>
              </table>
          </div>
          <div style="height: 438px">
              <div style="height:100%;width:50%;float:left;border:1px solid #ccc">
                  <el-checkbox-group v-model="Reason_select" size="medium">
                      <el-checkbox v-for="item in  List_reason" :label="item.label" :key="item.value" v-model="item.value" style="min-width: 100px;height:30px;top:5px;left:5px" @change="Selected_res"></el-checkbox>
                  </el-checkbox-group>
              </div>
              <div style="height:100%;width:50%;float:right">
                  <el-input type="textarea" v-model="Txt_reson" :rows="24" placeholder="" style="min-height:96px;height:96px" show-word-limit></el-input>
              </div>
              <!--vxe-table class="bldlist" :data="fee_list" :loading="floading" :select-config="{reserve: true}" :sort-config="{trigger: 'cell',checkAll: true, reserve: true }" border show-header-overflow :keyboard-config="keyConfig" :show-footer="true" highlight-current-row highlight-hover-column ref="feetable" resizable show-overflow size="mini" stripe height="100%" :auto-resize=" true" :edit-config="{trigger: 'click', mode: 'cell',showStatus: true,showIcon:false,  activeMethod: activemethod }">
                  <vxe-table-column type="selection" width="40" align="center" v-if="Showselct"></vxe-table-column>
                  <vxe-table-column field="bloodcode" title="血袋编码" width="120" header-align="center" align="left"> </vxe-table-column>
                  <vxe-table-column field="compname" title="血液成分" width="80" header-align="center" align="left">
                  </vxe-table-column>
                  <vxe-table-column field="abo" title="ABO" width="40" header-align="center" align="center"> </vxe-table-column>
                  <vxe-table-column field="rh" title="Rh(D)" width="40" header-align="center" align="center"> </vxe-table-column>
                  <vxe-table-column field="spec" title="规格" width="50" header-align="center" align="center"> </vxe-table-column>
                  <vxe-table-column field="feeitemname" title="收费项目" width="150" header-align="center"> </vxe-table-column>
                  <vxe-table-column field="qty" title="数量" width="60px" header-align="center" align="center" :edit-render="{name: 'input', autoselect:true, events: {change:Qty_change,keyup: Qty_moverow}}"> </vxe-table-column>
                  <vxe-table-column field="itemprice" title="单价" width="50" header-align="center" align="center"> </vxe-table-column>
                  <vxe-table-column field="amounts" title="金额" width="50" header-align="center" align="center"> </vxe-table-column>
                  <vxe-table-column field="feeitemcode" title="收费代码" width="100" header-align="center"> </vxe-table-column>
                  <vxe-table-column field="transid" title="明细ID" width="60" header-align="center"> </vxe-table-column>
                  
              </vxe-table-->
          </div>
      </div>
  </el-dialog>

</template>

<script>
export default {
  name: "rmpopselectreason",
  //props: { width: { type: String, default: "200px" }, value: [Number, String], fee_list: { type: Array }, appendtobody: { type: Boolean, default: true }, //dataname: { type: String }, param1: { type: String } },
  data() {
      return {
          tableData: null,
          pop_select: false,
          floading: false,
          List_reason: [],
          Txt_reson: "",
          Charge_user: "", // 计价人
          Showselct: false,
          Reason_select: [],
          poptitle:"",
          keyConfig: {
              isDel: false,
              isTab: true,
              isEdit: true,
              isArrow: true,
              enterToTab: true,
              isEnter: true
          },
          keyLocalConfig: {
              isArrow: true
          }
      };
  },
  watch: {},
  computed: {
      datacnt() {
          // return this.fee_list.length;
      }
  },
  mounted() {},
  created() {},
  methods: {
      Selected_res(value, checked, label) {
          console.log(value);
          //   console.log(checked);
          //     console.log(label);
          this.Txt_reson = this.Reason_select.toString();
      },
      OpenPopReson(resontype, reson_in,title) {
          console.log(reson_in);
          this.Txt_reson = "";
          this.Reason_select = [];
          //popselectreason
          this.poptitle = "说明:左边可勾选"+title+",右边输入框可直接录入文字";
          this.$tool
              .request({
                  url: "ucent/bldlib",
                  method: "post",
                  data: {
                      action: "getresonlist",
                      kindno: resontype
                  }
              })
              .then(res => {
                  this.List_reason = res.dclist;
                  if (reson_in != "" &&  reson_in != null) {
                      this.Reason_select =  reson_in.split(",");
                      this.Txt_reson =  reson_in;
                      // console.log(this.Order_patinfo.trans_objectivename);
                  }
                  this.pop_select = true;
              });

          //原因字典加载
      },
      Select_ok() {
          // 返回的值 处理
          this.pop_select = false;
          this.$emit("select_ok", 2, this.Txt_reson);
      },

      Select_cancle() {
          this.pop_select = false;
          //取消计价,  取消审核或出库
          this.$emit("select_cancle", "");
      }
  }
};
</script>
<style scoped>
.el-main {
  padding: 0;
}
.pagetop {
  width: 100%;
  height: 35px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
  z-index: 99;
}
.reportoper {
  width: 100%;
  height: 40px;
  line-height: 40px;
  overflow: hidden;

  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  z-index: 99;
  align-items: center;
  border: 1px solid #ccc;
}
.top-deal {
  right: 5px;
  position: absolute;
  top: 5px;
  display: flex;
  align-items: center;
}

v-deep .bldlist .col-blue {
  color: blue;
}

v-deep .el-dialog--center .el-dialog__body {
  padding-top: 0px;
  padding-bottom: 0px;
  padding-left: 4px;
  padding-right: 4px;
}
v-deep  .el-button--small {
  min-width: 60px;
}

</style>